# 导包
import x.lang.system
import x.lang.time

# 回调函数
fun callback := (index) -> {
    println("current index is:", index)
}

# 循环函数
fun loop := (start, end, step) -> {
    var index:int = start
    if (index <= end) -> {
        callback(index)
        set index += step
        loop(index, end, step)
    }
}

# 开始循环
loop(1, 10, 2)